package de.ff7rl.core;

public class PointPool {

  private int current;
  private int maximum;

  public PointPool(final int thePoints) {
    current = thePoints;
    maximum = thePoints;
  }

  public int getCurrent() {
    return current;
  }

  public int getMaximum() {
    return maximum;
  }

  public int getPercent() {
    final float percent = (float) current / (float) maximum;
    return (int) (100 * percent);
  }

  public void increaseCurrent(final int theValue) {
    current += theValue;
    if (current < 0) {
      current = 0;
    }
    if (current > maximum) {
      current = maximum;
    }
  }

  public void increaseMaximum(final int theValue) {
    maximum += theValue;
  }

  public boolean isEmpty() {
    return current == 0;
  }

}
